package com.lytis.zoovideo.entity.vo;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.lytis.zoovideo.entity.Video;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @author :DongPeiLei
 * @description :
 * @create :2022-06-07 00:06:00
 */
@Data
@NoArgsConstructor
public class VideoVo {
    public VideoVo(Video video) {
        this.id = video.getId();
        this.videoPath = video.getVideoPath();
        this.coverPath = video.getCoverPath();
        this.userId = video.getUserId();
        this.type = video.getType();
        this.views = video.getViews();
        this.enshrine = video.getEnshrine();
        this.likes = video.getLikes();
        this.title = video.getTitle();
        this.createdAt = video.getCreatedAt();
        this.updatedAt = video.getUpdatedAt();
    }

    /**
     * 视频id
     */
    @TableId
    private Integer id;

    /**
     * 视频地址
     */
    private String videoPath;

    /**
     * 上传用户的id
     */
    private Integer userId;

    /**
     * 分类id
     */
    private Integer type;

    /**
     * 播放量
     */
    private Long views;

    /**
     * 收藏量
     */
    private Long enshrine;

    /**
     * 点赞数量
     */
    private Long likes;

    /**
     * 视频标题
     */
    private String title;

    /**
     * 封面地址
     */
    private String coverPath;
    /*
     * 点赞列表
     * */
    private List<Integer> likedUserList;
    /*
     * 收藏列表
     * */
    private List<Integer> enshrinedUserList;
    /* 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createdAt;

    /**
     * 修改时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updatedAt;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}
